﻿
Namespace LightSwitchApplication

    Public Class MEDDEXDataService

#Region " - allergy - "
        Private Sub Allergies_Inserting(entity As Allergy)
            entity.datecreated = Now
            entity.userno = Application.Current.User.Name
        End Sub
#End Region ' - allergy - 

#Region " - doctor - "
        Private Sub DoctorDetails_Inserting(entity As DoctorDetail)
            entity.DateCreated = Now
            entity.userno = Application.Current.User.Name
        End Sub
#End Region ' - doctor - 

#Region " - medication - "
        Private Sub Medications_Inserting(entity As Medication)
            entity.PrescribedDate = Now
            entity.UserNo = Application.Current.User.Name
        End Sub
#End Region ' - medication - 

#Region " - patients - "
        Private Sub Patients_Inserting(entity As Patient)
            entity.createdate = Now
            entity.createdby = Application.Current.User.Name

            entity.userno = Application.Current.User.Name

            entity.lastmodifieddate = Now
            entity.lastmodifiedby = Application.Current.User.Name
        End Sub

        Private Sub Patients_Updating(entity As Patient)
            entity.lastmodifieddate = Now
            entity.lastmodifiedby = Application.Current.User.Name
        End Sub

        Private Sub Patients_Deleting(entity As Patient)
            entity.lastmodifieddate = Now
            entity.lastmodifiedby = Application.Current.User.Name
        End Sub
#End Region ' - patients - 

#Region " - pregnancy - "
        Private Sub Pregnancies_Inserting(entity As Pregnancy)
            entity.datecreated = Now
            entity.userno = Application.Current.User.Name
        End Sub
#End Region ' - pregnancy -
        
#Region " - pregnancy - previous - "
        Private Sub PreviousPregnancies_Inserting(entity As PreviousPregnancy)
            entity.DateCreated = Now
            entity.UserNo = Application.Current.User.Name
        End Sub
#End Region ' - pregnancy - previous - 


#Region " - pregnancy - prenatal visits - "
        Private Sub PrenatalVisits_Inserting(entity As PrenatalVisit)
            entity.DateCreated = Now
            entity.UserNo = Application.Current.User.Name
        End Sub
#End Region '- pregnancy - prenatal visits -
        
    End Class

End Namespace
